public class Animal {
    private boolean[] features = new boolean[15]; // 假设有15种特征

    public void setFeature(String feature, boolean value) {
        switch (feature) {
            case "HAS_MILK":
                features[0] = value;
                break;
            case "HAS_FEATHERS":
                features[1] = value;
                break;
            case "CAN_FLY":
                features[2] = value;
                break;
            case "CAN_LAY_EGGS":
                features[3] = value;
                break;
            case "EATS_MEAT":
                features[4] = value;
                break;
            case "HAS_SHARP_TEETH":
                features[5] = value;
                break;
            case "HAS_CLAWS":
                features[6] = value;
                break;
            case "EYES_FACE_FRONT":
                features[7] = value;
                break;
            case "HAS_HOOVES":
                features[8] = value;
                break;
            case "RUMINANT":
                features[9] = value;
                break;
            case "HAS_TAN_COLOR":
                features[10] = value;
                break;
            case "HAS_BLACK_STRIPES":
                features[11] = value;
                break;
            case "HAS_DARK_SPOTS":
                features[12] = value;
                break;
            case "HAS_LONG_NECK":
                features[13] = value;
                break;
            case "HAS_LONG_LEGS":
                features[14] = value;
                break;
            default:
                throw new IllegalArgumentException("Unknown feature: " + feature);
        }
    }

    public boolean hasFeature(String feature) {
        switch (feature) {
            case "HAS_MILK":
                return features[0];
            case "HAS_FEATHERS":
                return features[1];
            case "CAN_FLY":
                return features[2];
            case "CAN_LAY_EGGS":
                return features[3];
            case "EATS_MEAT":
                return features[4];
            case "HAS_SHARP_TEETH":
                return features[5];
            case "HAS_CLAWS":
                return features[6];
            case "EYES_FACE_FRONT":
                return features[7];
            case "HAS_HOOVES":
                return features[8];
            case "RUMINANT":
                return features[9];
            case "HAS_TAN_COLOR":
                return features[10];
            case "HAS_BLACK_STRIPES":
                return features[11];
            case "HAS_DARK_SPOTS":
                return features[12];
            case "HAS_LONG_NECK":
                return features[13];
            case "HAS_LONG_LEGS":
                return features[14];
            default:
                throw new IllegalArgumentException("Unknown feature: " + feature);
        }
    }
}
